//
//  HZFindCategoriesColHeadModel.m
//  app
//
//  Created by 刘华舟 on 15/5/29.
//  Copyright (c) 2015年 hdaren. All rights reserved.
//

#import "HZFindCategoriesColHeadModel.h"

@implementation HZFindCategoriesColHeadModel

+ (instancetype)modelWithDictionary:(NSDictionary *)dict type:(HZFindSecHeadType)type additional:(NSDictionary *)add{
    return [[HZFindCategoriesColHeadModel alloc] initModelWithDictionary:dict type:type additional:add];
}
- (instancetype)initModelWithDictionary:(NSDictionary *)dict type:(HZFindSecHeadType)type additional:(NSDictionary *)add{
    if (self = [super init]) {
        
        _type = type;
        switch (type) {
            case HZFindSecHeadTypePicture:
            {
                _adURI = [add stringForKey:APIKEY_mall_aduri nilValue:@"-1"];
                _adName = [add stringForKey:APIKEY_mall_adname nilValue:@""];
                _adPic = [add stringForKey:APIKEY_mall_adpic nilValue:@""];
                _adType = [add stringForKey:APIKEY_mall_adtype nilValue:@""];
            }
                break;
                
            default:
                break;
        }
        _title = [dict stringForKey:APIKEY_mall_level2title nilValue:@""];
        _levelID = [dict stringForKey:APIKEY_mall_level2id nilValue:@"0"];
        
        NSMutableArray *lists = [NSMutableArray array];
        
        for (NSDictionary *cell in [dict arrayForKey:APIKEY_mall_level2detail]) {
            HZFindCategoryColCellModel *model = [HZFindCategoryColCellModel modelWithDictionary:cell];
            [lists addObject:model];
        }
        
        _detailArray = lists;
        
    }
    return self;
}

@end
